home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
parcs
/
readme.doc
< prev
Wrap
Text File
|
1992-06-07
|
6KB
|
212 lines
<PARCS Ver 1.0 Users' Manual>
This is a users' manual for pseudo-parallel version of PARCS (PARallel
Constraint Solving). PARCS is a parallel constraint logic programming
language whose computational domain is Herbrand Universe and finite
domains (symbol, integer). Though program syntax is similar to that of
Prolog, you have to take care because semantics is rather different (
especially ',' and ';' ).
You also have to be careful in memory usage. Inappropriate environment
setting may cause the memory usage to explode.
Our paper on pseudo-parallel version of PARCS is ftp available
(~ftp/pub/papers/lpc91-parcs-a4.ps.Z).
Real parallel version for iPSC/2, Luna88k, and AP1000 will also be ftp
available in future.
[0]. Makefile
Source files are in ~ftp/pub/parcs/source.
Makefiles are
Makefile.sun4 for Sun SPARC Station
Makefile.luna88k for Luna88k
Makefile.next for NeXT
So you can make program by the following command:
% mv Makefile.sun4 Makefile
% make
[1]. Invocation and Termination of PARCS
If you execute the command 'parcs', the following prompt appears.
<PARCS>
Command to terminate program is #quit.
<PARCS>#quit.
%
[2]. Top Level
In the top level (when the prompt <PARCS> appears),
you can execute the following:
(A) Special Command
The command whose first letter is '#'.
(B) Definition of Clause
(C) Query
[3]. Special Command
The following commands are available.
Strings in arguments should be enclosed by '"'
#cwd
Syntax #cwd(<directry name>).
Semantics Change current Working Directry
#learn-and
#learn-or
#load
Syntax #load(<file name>).
Semantics Recover the environment that was saved in the file.
".cod" is automatically added to the file name.
#msize
Syntax #msize <chunk size>.
Semantics Change memory size. Try to execute this command when
the message "Out of Memory" is reported.
Size should be 4196, 8192, 16384, 32768,...
#pred
#priority
#read
Syntax #read(<file name>).
Semantics Read program.
".parcs" is automatically added to the file name.
#quit
Syntax #quit.
Semantics Quit parcs.
#save
Syntax #save(<file name>).
Semantics Save the current environment (definition of clauses, priority parameter)
to the file. ".cod" is automatically added to the file name.
#set
#setprior
#shell
Syntax #shell(<shell command>).
Semantics Execute shell command.
[4] Program Syntax
Sample programs are in ~ftp/parcs/sample
[3.1]definition of finite domains
Declaration of finite domain name is the form of
defdomain <domain name> <domain>.
Declaration of domain variable is
<domain name>(<variable sequence>)
[Example]
defdomain foo int{-1,1,3,5}.
defdomain bar int{1..9}.
defdomain baz foo{0..4}. /* intersection of foo and {0..4} */
defdomain tako {a,b,c,d}. /* finite sets of symbol */
p(X) :- foo(X), /* The value of X is one of {-1,1,3,5}.*/
...
[3.2]Clause and Goal
Clause is the form of
Head :- Body.
and goal is the form of
:- Body.
Body is the sequence of atoms constraints, declarations of domain variables.
If you write
p :- q, r.
then q and r is executed in parallel.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To specify explicitly the sequential execution, please use ';' instead of ","
as follows:
p :- q; r.
[Example]
:- q, r. /* q, r is executed in parallel */
:- q; r. /* q, r is sequentially executed */
:- q; r,s. /* q is executed at first, then r and s are executed in parallel */
:- q, (r;s). /* q and r are executed in parallel, then after r is resolved,
s is executed */
[3.3]Setting of priority parameter
Use #priority command. (See paper)
[3.4]Comment
/* */
[3.X] Syntax
Whole syntax is as follows:
<statement> ::= <defdomain> | <clause> | { <system-command>}
<defdomain> ::= {defdomain} <dname> (<dname>)<set>
<dname> ::= <symbol>
<set> ::= { <range> } | { <int-sequence> } |
{ <sym-sequence> }
<range> ::= <integer> .. <integer>
<int-sequence> ::= <integer> {, <integer>}
<sym-sequence> ::= <symbol> {, <symbol>}
<clause> ::= <head> .|
<head> :- <body>|
{:-} <body>
<head> ::= <atom>
<body> ::= <seq-literals>
<seq-literals> ::= <par-literals> {; <par-literals>}
<par-literals> ::= <unit-literal> {, <unit-literal>}
<unit-literal> ::= <literal> | ( <seq-literals> )
<literal> ::= <atom> | <s-constraint> | <m-constraint>
<atom> ::= <predicate> |
::= <predicate> ( <term> { , <term>} )
<sym-expression> ::= <term> <sym-predicate> <term>
<math-expression> ::= <integer> | <variable> |
- <expression> |
( <expression> )|
<expression> <math-predicate> <expression>
<expression> ::= <expression> <operator> <expression>
<sym-predicate> ::= == | !==
<math-predicate> ::= = | != | < | > | <= | >=
<operator> ::= + | - | * | div | mod
<term> ::= <integer> | <symbol> | <variable> |
<func-term> | <list-term>
<func-term> ::= <symbol> ( <term> { , <term>} )
<list-term> ::= [ ] | [<term> { , <term>} (|<term>)]
[X]. Questions and comments are welcome to koba@is.s.u-tokyo.ac.jp